import request from '@/utils/request'

export const createCodePostRequire = (server, params) => {
    return request({
        url: 'api/createCode/' + server,
        method: 'post',
        data: params
    })
}

export const createCodeDownload = (server, params) => {
    return request({
        url: 'api/createCode/' + server,
        method: 'post',
        data: params,
        responseType: "blob"
    })
}


export const createCodeByConfig = (server, params, config) => {
    let headers = {
        'Content-Type': 'application/x-www-form-urlencoded'
    }
    return request({
        url: 'api/createCode/' + server,
        method: 'post',
        data: params,
        headers: Object.assign(headers, config)
    })
}
